package com.kadron.session;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.jboss.seam.Component;

import com.kadron.dao.KCurrencyDAO;
import com.kadron.entity.Currency;
import com.kadron.manager.KMessageManager;

public abstract class AbstractCurrencySelector extends KMessageManager implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -3163019972889995482L;
	
	public abstract void changeCurrency(Currency newc);
	
	private List<Currency> currencies = new ArrayList<Currency>();

	public List<Currency> getCurrencies() {
		if (currencies.isEmpty()) {
			KCurrencyDAO currencyDAO = (KCurrencyDAO) Component.getInstance("currencyDAO");
			currencies = currencyDAO.getAll(Currency.class);
		}
		return currencies;
	}
	
}
